Enable Xen hypervisor support. Resulting kernel runs
both as a guest OS on Xen and natively on hardware.
-config ARCH_XEN
- bool
- default y
- depends on XEN
- help
- TEMP ONLY. Needs to be on for drivers/xen to build.
-
config XEN_IA64_DOM0_VP
bool "dom0 vp model"
depends on XEN
iosapic_intr_info[vector].dmode = delivery;
iosapic_intr_info[vector].trigger = trigger;
-#ifdef CONFIG_XEN
if (is_running_on_xen())
return 0;
-#endif
if (trigger == IOSAPIC_EDGE)
irq_type = &irq_type_iosapic_edge;
}
pcat_compat = system_pcat_compat;
-#ifdef CONFIG_XEN
if (is_running_on_xen())
return;
-#endif
+
if (pcat_compat) {
/*
* Disable the compatibility mode interrupts (8259 style), needs IN/OUT support
assign_irq_vector (int irq)
{
int pos, vector;
+
#ifdef CONFIG_XEN
- extern int xen_assign_irq_vector(int);
- if (is_running_on_xen())
+ if (is_running_on_xen()) {
+ extern int xen_assign_irq_vector(int);
return xen_assign_irq_vector(irq);
-#endif /* CONFIG_XEN */
+ }
+#endif
again:
pos = find_first_zero_bit(ia64_vector_mask, IA64_NUM_DEVICE_VECTORS);
vector = IA64_FIRST_DEVICE_VECTOR + pos;
setup_arch (char **cmdline_p)
{
unw_init();
+
#ifdef CONFIG_XEN
if (is_running_on_xen())
setup_xen_features();
/* size of physical stacked register partition plus 8 bytes: */
__get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8;
platform_cpu_init();
+
#ifdef CONFIG_XEN
/* Need to be moved into platform_cpu_init later */
if (is_running_on_xen()) {
xen_smp_intr_init();
}
#endif
+
pm_idle = default_idle;
}
obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += blkfront/
obj-$(CONFIG_XEN_NETDEV_FRONTEND) += netfront/
obj-$(CONFIG_XEN_BLKDEV_TAP) += blktap/
-obj-$(CONFIG_XEN_TPMDEV_FRONTEND) += tpmfront/
obj-$(CONFIG_XEN_PCIDEV_BACKEND) += pciback/
obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += pcifront/
#include <linux/config.h>
#include <asm/machvec.h>
#ifdef CONFIG_XEN_IA64_DOM0_VP
-#include <asm/hypervisor.h> //XXX to compile arch/i386/kernel/swiotlb.c
- // and arch/i386/kernel/pci-dma-xen.c
-#include <asm-i386/mach-xen/asm/swiotlb.h> //XXX to compile arch/i386/kernel/swiotlb.c
+/* Needed for arch/i386/kernel/swiotlb.c and arch/i386/kernel/pci-dma-xen.c */
+#include <asm/hypervisor.h>
+/* Needed for arch/i386/kernel/swiotlb.c */
+#include <asm-i386/mach-xen/asm/swiotlb.h>
#endif
#ifndef CONFIG_XEN_IA64_DOM0_VP
#define dma_is_consistent(dma_handle) (1) /* all we do is coherent memory... */
#ifdef CONFIG_XEN_IA64_DOM0_VP
-// arch/i386/kernel/swiotlb.o requires
+/* arch/i386/kernel/swiotlb.o requires */
void contiguous_bitmap_init(unsigned long end_pfn);
static inline int
#ifndef __HYPERVISOR_H__
#define __HYPERVISOR_H__
+#ifndef CONFIG_XEN
+#define is_running_on_xen() (0)
+#define HYPERVISOR_ioremap(offset, size) (offset)
+#else
+extern int running_on_xen;
+#define is_running_on_xen() (running_on_xen)
+#endif
+
+#ifdef CONFIG_XEN
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <asm/hypercall.h>
#include <asm/ptrace.h>
#include <asm/page.h>
-#include <asm/xen/privop.h> // for is_running_on_xen()
extern shared_info_t *HYPERVISOR_shared_info;
extern start_info_t *xen_start_info;
asmlinkage int xprintk(const char *fmt, ...);
#define xprintd(fmt, ...) xprintk("%s:%d " fmt, __func__, __LINE__, \
##__VA_ARGS__)
+#endif /* CONFIG_XEN */
#endif /* __HYPERVISOR_H__ */
#define PIO_RESERVED __IA64_UNCACHED_OFFSET
#define HAVE_ARCH_PIO_SIZE
+#include <asm/hypervisor.h>
#include <asm/intrinsics.h>
#include <asm/machvec.h>
#include <asm/page.h>
+#include <asm/privop.h>
#include <asm/system.h>
#include <asm-generic/iomap.h>
-#ifdef CONFIG_XEN
-#include <asm/privop.h>
-#include <asm/hypervisor.h>
-#endif
/*
* Change virtual addresses to physical addresses and vv.
#define page_to_pseudophys(page) \
((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
-// XXX
-// the following drivers are broken because they use page_to_phys() to
-// get bus address. fix them.
-// drivers/ide/cris/ide-cris.c
-// drivers/scsi/dec_esp.c
+
+/*
+ * Drivers that use page_to_phys() for bus addresses are broken.
+ * This includes:
+ * drivers/ide/cris/ide-cris.c
+ * drivers/scsi/dec_esp.c
+ */
#define page_to_phys(page) (page_to_pseudophys(page))
#define bvec_to_bus(bv) (page_to_bus((bv)->bv_page) + \
(unsigned long) (bv)->bv_offset)
static inline void __iomem *
ioremap (unsigned long offset, unsigned long size)
{
-#ifdef CONFIG_XEN
offset = HYPERVISOR_ioremap(offset, size);
-#endif
return (void __iomem *) (__IA64_UNCACHED_OFFSET | (offset));
}
#include <xen/features.h> // to compile netback, netfront
typedef unsigned long maddr_t; // to compile netback, netfront
-// XXX hack!
-// Linux/IA64 uses PG_arch_1.
-// This hack will be removed once PG_foreign bit is taken.
-//#include <xen/foreign_page.h>
+/*
+ * XXX hack!
+ * Linux/IA64 uses PG_arch_1.
+ * This hack will be removed once PG_foreign bit is taken.
+ * #include <xen/foreign_page.h>
+ */
#ifdef __ASM_XEN_FOREIGN_PAGE_H__
# error "don't include include/xen/foreign_page.h!"
#endif
})
#define HAVE_ARCH_FREE_PAGE
-//XXX xen page size != page size
+/* XXX xen page size != page size */
static inline unsigned long
pfn_to_mfn_for_dma(unsigned long pfn)
#define set_phys_to_machine(pfn, mfn) do { } while (0)
#define xen_machphys_update(mfn, pfn) do { } while (0)
-//XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m))
+/* XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m)) */
#define FOREIGN_FRAME(m) (INVALID_P2M_ENTRY)
#define mfn_to_pfn(mfn) (mfn)
*
*/
-#include <linux/config.h>
#ifdef CONFIG_XEN
#include <asm/xen/privop.h>
#endif
#endif
#ifndef __ASSEMBLY__
-extern int running_on_xen;
-#define is_running_on_xen() running_on_xen
-
#define XEN_HYPER_SSM_I asm("break %0" : : "i" (HYPERPRIVOP_SSM_I))
#define XEN_HYPER_GET_IVR asm("break %0" : : "i" (HYPERPRIVOP_GET_IVR))